import { Demo1Component } from './demo1/demo1.component';
import { CustomizeComponent } from './customize/customize.component';
import { Demo3Component } from './demo3/demo3.component';
import { Demo4Component } from './demo4/demo4.component';
import { UpdateComponent } from './update/update.component';
import { Demo8Component } from './demo8/demo8.component';
import { BasicComponent as MessageBoxBasicComponent } from '../message-box/basic/basic.component';
import { ConfirmComponent as MessageBoxConfirmComponent } from '../message-box/confirm/confirm.component';
import { CustomizeComponent as MessageBoxCustomizeComponent } from '../message-box/customize/customize.component';

export const ModalConfig = {
  location: 'Modal',
  description: `对话框承载当前页面事物处理的相应操作，提供普通的弹窗和视窗边缘滑出弹窗 (抽屉)。支持 <lv-modal> 标签调用、服务调用，推荐使用服务调用。
  支持通过String、Template、Component等多种方式定义弹窗内容，在Component中可以通过依赖注入ModalRef方式直接获取对话框的组件实例和方法，用于控制在弹出层组件中控制对话框行为。
  `,
  description_en: `Modal is carried with corresponding operation, which provides normal popup and the edge of window sliding out popup (drawer). <lv-modal> tag and service are supported to call modal while service call is recommended.
	String, Template, Component, etc. are supported to define the content of popup.
	In the component, instances and methods of modal can be obtained directly through dependency injection ModalRef, which is used to control modal behavior in the components of popup layer.`,
  component: [
    {
      demo: Demo1Component,
      codePath: 'showcase/modal/demo1/demo1.component',
      demoTitle: '基础',
      demoTitle_en: 'Basic',
      demoDescription: '支持 <lv-modal> 标签、服务调用 (推荐) 两种方式。',
      demoDescription_en: '<lv-modal> tag and service (recommended) are supported to call this component.',
    },
    {
      demo: CustomizeComponent,
      codePath: 'showcase/modal/customize/customize.component',
      demoTitle: '自定义',
      demoTitle_en: 'Custom',
      demoDescription:
        '支持自定义头部 (Sting / Template)，内容 (Sting / Template / Component)和底部 (Sting / Template / ModalButton)。内容区为 Component 时，则需要在NgModule中的 declarations 加入自定义的Component。',
      demoDescription_en:
        'Custom of header (Sting / Template), content (Sting / Template / Component) and footer (Sting / Template / ModalButton) are supported. When the content is Component, customized Component should be added to declarations in NgModule.',
    },
    {
      demo: Demo4Component,
      codePath: 'showcase/modal/demo4/demo4.component',
      demoTitle: '独立弹窗',
      demoTitle_en: 'Independent Modal',
      demoDescription: '在窗体的内容组件中配置参数和逻辑处理。',
      demoDescription_en: 'Configure parameters and logic processing in the content component of the modal.',
    },
    {
      demo: Demo3Component,
      codePath: 'showcase/modal/demo3/demo3.component',
      demoTitle: '异步事件',
      demoTitle_en: 'Asynchronous Event',
      demoDescription:
        '点击默认的“确认、取消”按钮和自定义按钮后可执行异步事件，返回 promise/Observe 可以延迟关闭(无需自定义按钮loading)，返回值为false可阻止关闭。',
      demoDescription_en:
        'Asynchronous event can be implemented by clicking default confirm/cancel button and custom button. Close can be delayed when promise is returned, and can be prevented if returned value is false.',
    },
    {
      demo: Demo8Component,
      codePath: 'showcase/modal/demo8/demo8.component',
      demoTitle: '气泡框',
      demoTitle_en: 'Popover',
      demoDescription: '气泡卡片类型的弹窗，在触发元素附近出现，内部样式沿用弹窗的样式',
      demoDescription_en: '',
      devDebug: true,
    },
    {
      demo: UpdateComponent,
      codePath: 'showcase/modal/update/update.component',
      demoTitle: '更新弹窗',
      demoTitle_en: 'Update',
      demoDescription: '更新弹窗的内容等参数。',
      demoDescription_en: 'Update the contents of the Modal and other parameters.',
    },
    {
      demo: MessageBoxBasicComponent,
      codePath: 'showcase/message-box/basic/basic.component',
      demoTitle: '信息提示框',
      demoTitle_en: 'Information pop-up window',
      demoDescription: '各种类型的信息提示，分为成功、提示、警告、危险、错误。',
      demoDescription_en: `Various types of information prompts, divided into success, prompt, warning, danger, and error.`,
    },
    {
      demo: MessageBoxConfirmComponent,
      codePath: 'showcase/message-box/confirm/confirm.component',
      demoTitle: '确认对话框',
      demoTitle_en: 'Confirmation dialog',
      demoDescription: '根据界面操作的影响来确定弹窗的级别。',
      demoDescription_en: 'The level of Confirm box is determined according to the impact caused by the operation of the interface.',
    },
    {
      demo: MessageBoxCustomizeComponent,
      codePath: 'showcase/message-box/customize/customize.component',
      demoTitle: '自定义信息提示框',
      demoTitle_en: 'Custom message box',
      demoDescription: '可传入一个 options 对象自定义对话框。',
      demoDescription_en: 'Can pass in an options object custom messageBox.',
    },
  ],
  selector: 'lv-modal',
  snippet: `
    <lv-modal [(lvVisible)]="\${1:visible}" [lvWidth]="\${2:600}" [lvHeader]="\${3:Title}" [lvFooter]="\${4:buttons}">
    \${5:This is modal content...}
    </lv-modal>
  `,
  mApi: [
    {
      name: 'Modal Service',
      name_en: 'Modal Service',
      event: [
        {
          event: 'create(a)',
          parameter: `options{}`,
          description: '创建弹窗，返回值为 ModalService 实例。可通过 ModalService.modals 列举所有弹窗实例。',
          description_en: `Create the modal. The returned value is the instance of ModalService. Use ModalService.modals to list all modal instances. `,
        },
        {
          event: 'update(a,b)',
          parameter: `lvModalKey, options{}`,
          description:
            '更新弹窗。约束：以下参数不能更新[ lvType、lvModalKey、lvModality、lvScrollBlock、lvOuterClosable、lvMaskTransparent ]。',
          description_en: `Update the modal. Constraints: the following parameters cannot update [ lvType、lvModalKey、lvModality、lvScrollBlock、lvOuterClosable、lvMaskTransparent ].`,
        },
        {
          event: 'destroyModal(a)',
          parameter: `lvModalKey`,
          description: '销毁指定弹窗实例。',
          description_en: 'Destroy a specified modal instance. ',
        },
        {
          event: 'destroyAllModals()',
          parameter: `--`,
          description: '销毁所有弹窗实例。',
          description_en: 'Destroy all modal instances.',
        },
      ],
    },
    {
      name: 'Modal 基本属性',
      name_en: 'Modal Base Options',
      api: [
        {
          attribute: 'lvType',
          type: 'modal | drawer | popover',
          default: 'modal',
          description: `对话框类型。`,
          description_en: `Types of modal.`,
        },
        {
          attribute: 'lvModalKey',
          type: 'string',
          default: 'null',
          description: `对话框的唯一性标识符，通过服务方式创建对话框时，请务必配置，以保证同一对话框的唯一性。`,
          description_en: `Unique identifier of modal. When you create a modal through service, you must configure it to ensure the uniqueness of the same modal.`,
        },
        {
          attribute: 'lvParentModalKeys',
          type: 'string[]',
          default: '--',
          description: `指定多级弹窗的关系，值为 lvModalKey 的数组。`,
          description_en: `Specifies the relationship between multi-level pop-up windows, the value is an array of lvModalKey.`,
        },
        {
          attribute: 'lvHeader',
          type: 'string | Template | null',
          default: '\'title\'',
          description: `对话框头部，支持字符串和 Template，当传入值为 null 时，隐藏头部。`,
          description_en: 'Header of modal, which supports String and Template. Header is hided if passed value is null.',
        },
        {
          attribute: 'lvContent',
          type: 'string | TemplateRef | Component',
          default: 'null',
          description: `对话框内容区，支持字符串、Template 和 Component。`,
          description_en: `Content of modal, which supports String, Template and Component. `,
        },
        {
          attribute: 'lvComponentParams',
          type: 'any',
          default: 'null',
          description: `lvContent 为 Component 时有效，通过此属性向 Component 传参({key：value})。`,
          description_en: `lvComponentParams is valid when lvContent is Component, and it is used to pass parameter to Component.`,
        },
        {
          attribute: 'lvFooter',
          type: `Array<ModalButton> | Template | null | 'default'`,
          default: 'default',
          description: `对话框底部，支持传入按钮数组 ModalButton 和 Template，当传入值为 null 时，隐藏底部; 配置default时显示预置的 Ok、Cancel 按钮。ModalButton 属性如下：
          <ul>
            <li>[id: string] 按钮 ID，具有唯一性 (可选)</li>
            <li>[label: string] 按钮的名称 (必选)</li>
            <li>[type: default | primary] 按钮类型，同 lvButton 的类型，默认'default' (可选)</li>
            <li>[danger: boolean] 危险按钮，同 lvButton，默认'false' (可选)</li>
            <li>[size: large | default] 按钮的大小 (可选)</li>
            <li>[loadingText: string] 异步事件时，按钮 Loading 状态下的文本 (可选)</li>
            <li>[loading: boolean] 按钮 Loading 状态，异步事件时，自动显示 Loading，默认值为 true (可选)</li>
            <li>[visible: boolean] 按钮可见性，默认值为 true (可选)</li>
            <li>[disabled: boolean] 按钮是否禁用，默认值 false (可选)</li>
            <li>[onClick: fn] 按钮左键单击事件 (可选)</li>
            <li>[tips: string] 鼠标划过按钮时，显示的提示信息 (可选)</li>
          </ul>`,
          description_en: `Footer of modal, which supports pass the button array ModalButton and Template. Footer is hided if passed value is null. Display preset Ok and Cancel buttons when not configured. Properties of ModalButton are as follows:
          <ul>
            <li>[id: string] Button ID，unique (optional)</li>
            <li>[label: string] Label of button (required)</li>
            <li>[type: default | primary] Type of button, which is same with the type of lvButton. The value is 'default' by default. (optional)</li>
            <li>[danger: boolean] Danger button, which is same with lvButton. The value is 'false' by default. (optional)</li>
            <li>[size: large | default] Size of button (optional)</li>
            <li>[loadingText: string] Text of the button at loading status during an asynchronous event (optional)</li>
            <li>[loading: boolean] Loading status of the button. Loading will be displayed automatically during an asynchronous event. The value is 'true' by default. (optional)</li>
            <li>[visible: boolean] Visibility of the button. The value is 'true' by default (optional)</li>
            <li>[disabled: boolean] Whether to disable the button. The value is 'false' by default. (optional)</li>
            <li>[onClick: fn] Event of click. (optional)</li>
            <li>[tips: string] The prompt message displayed when the mouse is over the button (optional)</li>
          </ul>`,
        },
        {
          attribute: 'lvVisible',
          type: 'boolean',
          default: 'false',
          description: `当以 <lv-modal> 标签使用时通过该属性控制对话框打开/关闭，请务必使用双向绑定 [(lvVisible)]="visible"。以服务调用时该属性无效。`,
          description_en: `When you are using <lv-modal> tag, use lvVisible to open or close the modal.
          Be sure to use two-way binding [(lvVisible)] = "visible". lvVisible is not valid when modal is called by service.`,
        },
        {
          attribute: 'lvWidth',
          type: 'number | string',
          default: 'auto',
          description: `对话框宽度。`,
          description_en: `Width of the modal.`,
        },
        {
          attribute: 'lvHeight',
          type: 'number | string',
          default: 'auto',
          description: `对话框高度。`,
          description_en: `Height of the modal`,
        },
        {
          attribute: 'lvIndex',
          type: 'number',
          default: '1000',
          description: `对话框层级 index。`,
          description_en: `Hierarchy of the index of the modal`,
        },
        {
          attribute: 'lvKeyboardEscape',
          type: 'boolean',
          default: 'false',
          description: `键盘事件，点击"ESC"键关闭对话框，默认不开启。`,
          description_en: `Keyboard event. Click 'ESC' to close the modal, which is turned off by default.`,
          global: true,
        },
        {
          attribute: 'lvCloseButtonDisplay',
          type: 'boolean',
          default: 'true',
          description: `关闭按钮的可见状态。`,
          description_en: `Visibility of the close button`,
        },
        {
          attribute: 'lvFocusButtonId',
          type: 'string',
          default: 'null',
          description: `设置当前对话框的焦点按钮；更改默认按钮 (Ok/Cancel) 的焦点，对应的ID分别为: 'ok'、'cancel'。`,
          description_en: `Set the focus button of current modal; change the focus of default button (OK/Cancel), the corresponding IDs of which are 'OK' and 'Cancel'.`,
        },
        {
          attribute: 'lvModality',
          type: 'boolean',
          default: 'true',
          description: `对话框是否为模态，模态对话框会显示遮罩，且对话框外的区域不可操作。`,
          description_en: `Whether the modal is in modality. If it is, modal displays the mask, and the panel outside the modal is unoperational.`,
        },
        {
          attribute: 'lvScrollBlock',
          type: 'boolean',
          default: 'true',
          description: `对话框打开后，页面是否锁定滚动。`,
          description_en: `Whether the page locks scrolling after the modal is opened.`,
        },
        {
          attribute: 'lvOuterClosable',
          type: 'boolean | { exclusions: HTMLElement[] }',
          default: 'false',
          description: `在弹窗外部点击时是否关闭对话框。可通过配置 { exclusions: HTMLElement[] | string } 排除元素（传入元素集合或querySelectorAll条件），排除的元素点击不关闭。`,
          description_en: `Whether to turn off the modal when click the panel outside the modal. You can configure {exclusions: HTMLElement[] | string } to exclude elements. If you click an excluded element, it will not be closed.`,
          global: true,
        },
        {
          attribute: 'lvMaskTransparent',
          type: 'boolean',
          default: 'false',
          description: `遮罩是否透明。`,
          description_en: `Whether the mask is transparent.`,
          global: true,
        },
        {
          attribute: 'lvDraggable',
          type: 'boolean',
          default: 'true',
          description: `是否可拖拽移动。该属性对抽屉模式无效。`,
          description_en: `Whether to drag and move. This feature does not take effect in drawer mode.`,
          global: true,
        },
        {
          attribute: 'lvResize',
          type: 'boolean | { max: number; min: number }',
          default: 'false',
          description: `是否可拖拽改变宽高。该属性只对抽屉模式有效。`,
          description_en: `Whether it can be dragged to change the width and height. This attribute is only valid for drawer mode.max: maximum width, min: minimum width.`,
          global: true,
        },
        {
          attribute: 'lvClass',
          type: 'string',
          default: 'null',
          description: `自定义弹窗样式。`,
          description_en: `Customize the style of the modal.`,
        },
        {
          attribute: 'lvDialogIcon',
          type: 'string',
          default: '--',
          description: `标题前的小图标，值为svg symbol id。`,
          description_en: `The small icon in front of the title, the value is svg symbol id.`,
        },
        {
          attribute: 'lvDrawerPosition',
          type: 'top | bottom | left | right',
          default: 'right',
          description: `当模式为抽屉 "drawer" 时，设置抽屉滑出的位置。`,
          description_en: `When the mode is drawer "drawer", sets the position where the drawer slides out.`,
          global: true,
        },
        {
          attribute: 'lvDrawerPositionOffset',
          type: 'array<value: string>',
          default: `[any, any, any, any]`,
          description: `当模式为抽屉 "drawer" 时，设置抽屉与视窗边缘的偏移值 [top, right, bottom, left]。`,
          description_en: `When the mode is 'drawer', set the value of offset [top, right, bottom, left] between drawer and the edge of modal.`,
          global: true,
        },
        {
          attribute: 'lvPopoverOrigin',
          type: 'ElementRef',
          default: `-`,
          description: `触发弹窗开启元素，lvType='popover'时生效，必选。`,
          description_en: `Trigger the pop-up window to open the element, it takes effect when lvType='popover', required.`,
        },
        {
          attribute: 'lvPopoverPosition',
          type: 'LvPositionType',
          default: `bottomLeft`,
          description: `弹窗位置，推荐使用 ('topLeft' | 'topRight' | 'rightTop' | 'rightBottom' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom')。`,
          description_en: `Popup location, it is recommended to use ('topLeft' | 'topRight' | 'rightTop' | 'rightBottom' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom').`,
        },
        {
          attribute: 'lvBeforeOpen',
          type: 'fn()',
          default: '--',
          description: `打开对话框前的回调函数，支持可执行函数、Promise、Observe，返回值为false可阻止打开。`,
          description_en: `Callback function before opening the modal. Supports executable functions, Promise and Observe. If the returned value is false, opening can be prevented.`,
        },
        {
          attribute: 'lvAfterOpen',
          type: 'fn(modal)',
          default: '--',
          description: `打开对话框后的回调函数。`,
          description_en: `Callback function after opening the modal.`,
        },
        {
          attribute: 'lvBeforeClose',
          type: 'fn(modal, result)',
          default: '--',
          description: `关闭对话框前的回调函数，传递当前 modal 实例和一个类型为 any 的参数。支持可执行函数、Promise、Observe，返回值为false可阻止关闭。`,
          description_en: `Callback function before closing the modal, transmit the current modal instance and a parameter of type any. Supports executable functions, Promise and Observe. If the returned value is false, closing can be prevented.`,
        },
        {
          attribute: 'lvAfterClose',
          type: 'fn(result)',
          default: '--',
          description: `关闭对话框后的回调函数，传递一个类型为 any 的参数。`,
          description_en: `Callback function after closing the modal, transmit a parameter of type any.`,
        },
      ],
    },
    {
      name: 'Modal 扩展属性（预置的 lvFooter 属性）',
      name_en: 'Modal Extend Options',
      api: [
        {
          attribute: 'lvOkLoading',
          type: 'boolean',
          default: 'false',
          description: `默认按钮 "OK" 的 Loading 状态。`,
          description_en: `Loading status of the default button 'OK'`,
        },
        {
          attribute: 'lvCancelLoading',
          type: 'boolean',
          default: 'false',
          description: `默认按钮 "Cancel" 的 Loading 状态。`,
          description_en: `Loading status of the default button 'Cancel'`,
        },
        {
          attribute: 'lvOkDisabled',
          type: 'boolean',
          default: 'false',
          description: `默认按钮 "OK" 的禁用状态。`,
          description_en: `Disable status of the default button 'OK'`,
        },
        {
          attribute: 'lvCancelDisabled',
          type: 'boolean',
          default: 'false',
          description: `默认按钮 "Cancel" 的禁用状态。`,
          description_en: `Disable status of the default button 'Cancel'`,
        },
        {
          attribute: 'lvOkText',
          type: 'string',
          default: 'Ok | 确定',
          description: `默认按钮 "OK" 的名称。`,
          description_en: `Text of the default button 'OK'`,
        },
        {
          attribute: 'lvOkTips',
          type: 'string',
          default: '',
          description: `滑过默认按钮 "OK" 时显示的提示信息`,
          description_en: `The prompt message displayed when sliding over the default button 'OK'`,
        },
        {
          attribute: 'lvCancelText',
          type: 'string',
          default: 'Cancel | 取消',
          description: `默认按钮 "Cancel" 的名称。`,
          description_en: `Text of the default button 'Cancel'`,
        },
        {
          attribute: 'lvCancelTips',
          type: 'string',
          default: '',
          description: `滑过默认按钮 "Cancel" 是显示的提示信息`,
          description_en: `The prompt message displayed when sliding over the default button 'Cancel'`,
        },
        {
          attribute: 'lvOkType',
          type: 'primary | link | default',
          default: 'primary',
          description: `默认按钮 "OK" 的类型。`,
          description_en: `The type of the default button "OK".`,
        },
        {
          attribute: 'lvCancelType',
          type: 'primary | link | default',
          default: 'default',
          description: `默认按钮 "Cancel" 的类型。`,
          description_en: `The type of the default button "Cancel".`,
        },
        {
          attribute: 'lvOkLoadingText',
          type: 'string',
          default: 'Loading',
          description: `默认按钮 "OK" 的 Loading 文本。`,
          description_en: `Loading text of the default button 'OK'`,
        },
        {
          attribute: 'lvCancelLoadingText',
          type: 'string',
          default: 'Loading',
          description: `默认按钮 "Cancel" 的 Loading 文本。`,
          description_en: `Loading text of the default button 'Cancel'`,
        },
        {
          attribute: 'lvOk',
          type: 'fn(modal)',
          default: '--',
          description: `点击对话框默认按钮 "OK" 时的执行函数。支持可执行函数、Promise、Observe，返回值为false可阻止关闭。`,
          description_en: `Executing function when clicking the default button 'OK' of the modal. Supports executable functions, Promise and Observe. If the returned value is false, closing can be prevented.`,
        },
        {
          attribute: 'lvCancel',
          type: 'fn(modal)',
          default: '--',
          description: `点击对话框默认按钮 "Cancel" 时的执行函数。支持可执行函数、Promise、Observe，返回值为false可阻止关闭。`,
          description_en: `Executing function when clicking the default button 'Cancel' of the modal. Supports executable functions, Promise and Observe. If the returned value is false, closing can be prevented.`,
        },
      ],
    },
    {
      name: 'ModalRef',
      name_en: 'ModalRef',
      event: [
        {
          event: 'setProperty',
          parameter: `options`,
          description:
            '设置 Modal 属性。约束：以下参数不能更新[ lvType、lvModalKey、lvModality、lvScrollBlock、lvOuterClosable、lvMaskTransparent ]。',
          description_en:
            'Set properties via ModalRef. Constraints: the following parameters cannot update [ lvType、lvModalKey、lvModality、lvScrollBlock、lvOuterClosable、lvMaskTransparent ].',
        },
        {
          event: 'getInstance',
          parameter: `--`,
          description: '获取 ModalService 实例后，获取弹窗的实例。',
          description_en: 'Get instance of Modal after getting the instance of ModalService.',
        },
        {
          event: 'getModalElement',
          parameter: `--`,
          description: '获取 ModalService 实例后，获取 Modal 弹窗的 HTMLElement 元素。使用方法参见 “抽屉” 示例。',
          description_en:
            'Get HTMLElement elements of Modal after getting the instance of ModalService. See the example of "Drawer" for usage.',
        },
        {
          event: 'getContentComponent',
          parameter: `--`,
          description: '当 Modal Content 为 Component 时，通过 ModalService 实例获取 Component 实例。使用方法参见 “抽屉” 示例。',
          description_en:
            'User can get the instance of ModalService by ModalService when Modal Content is Component. See the example of "Drawer" for usage.',
        },
        {
          event: 'open',
          parameter: `--`,
          description: '获取 ModalService 实例后，手动打开 Modal。',
          description_en: 'Open Modal manually after getting the instance of ModalService.',
        },
        {
          event: 'close',
          parameter: `--`,
          description: '获取 ModalService 实例后，手动关闭 Modal。可配置一个类型为 any 的参数。',
          description_en: 'Close Modal manually after getting the instance of ModalService. A parameter of type any can be configured.',
        },
        {
          event: 'triggerOk',
          parameter: `--`,
          description: '获取 ModalService 实例后，手动执行默认的 "Ok" 按钮的方法。',
          description_en: `Implement the default methods of button 'OK' after getting the instance of ModalService.`,
        },
        {
          event: 'triggerCancel',
          parameter: `--`,
          description: '获取 ModalService 实例后，手动执行默认的 "Cancel" 按钮的方法。',
          description_en: `Implement the default methods of button 'Cancel' after getting the instance of ModalService.`,
        },
        {
          event: 'triggerCustomButton',
          parameter: `id`,
          description: '获取 ModalService 实例后，手动执行自定义按钮的方法。参数为自定义按钮的 id。',
          description_en: `Implement the methods of custom button after getting the instance of ModalService. Parameter is the ID of the custom button.`,
        },
      ],
    },
    {
      name: 'MessageBox Service',
      name_en: 'MessageBox Service',
      api: [
        {
          attribute: 'confirm',
          type: 'fn',
          default: '--',
          description: `弹出确认对话框，调用方法：MessageboxService.confirm(params)，params 可以是一个 options 对象或字符串。`,
          description_en: `Pop up confirmation messageBox, call method:MessageboxService.confirm(params),params can be an options object or string.`,
        },
        {
          attribute: 'info',
          type: 'fn',
          default: '--',
          description: `弹出提示对话框，调用方法：MessageboxService.info(params)，params 可以是一个 options 对象或字符串。`,
          description_en: `Pop up info messageBox, call method:MessageboxService.info(params),params can be an options object or string.`,
        },
        {
          attribute: 'success',
          type: 'fn',
          default: '--',
          description: `弹出成功对话框，调用方法：MessageboxService.success(params)，params 可以是一个 options 对象或字符串。`,
          description_en: `Pop up success messageBox, call method:MessageboxService.success(params)，params can be an options object or string.`,
        },
        {
          attribute: 'warning',
          type: 'fn',
          default: '--',
          description: `弹出警告对话框，调用方法：MessageboxService.warning(params)，params 可以是一个 options 对象或字符串。`,
          description_en: `Pop up warning messageBox, call method:MessageboxService.warning(params),params can be an options object or string.`,
        },
        {
          attribute: 'error',
          type: 'fn',
          default: '--',
          description: `弹出错误对话框，调用方法：MessageboxService.error(params)，params 可以是一个 options 对象或字符串。`,
          description_en: `Pop up error messageBox, call method:MessageboxService.error(params),params can be an options object or string.`,
        },
        {
          attribute: 'danger',
          type: 'fn',
          default: '--',
          description: `弹出危险对话框，调用方法：MessageboxService.danger(params)，params 可以是一个 options 对象或字符串。`,
          description_en: `Pop up danger messageBox, call method：MessageboxService.danger(params),params can be an options object or string.`,
        },
      ],
    },
    {
      name: 'MessageBox Options ',
      name_en: 'MessageBox Options ',
      api: [
        {
          attribute: 'lvHeader',
          type: 'string | TemplateRef',
          default: '--',
          description: `对话框头部，支持字符串和 Template，默认值对应类型分别为：确认、提示、成功、告警、危险、错误。`,
          description_en: `The header of the messageBox box supports strings and Templates. The default values are: confirmation, prompt, success, alarm, danger, error.`,
        },
        {
          attribute: 'lvContent',
          type: 'string | TemplateRef',
          default: 'null',
          description: `对话框内容区，支持字符串 和 TemplateRef。`,
          description_en: `MessageBox content area, support string and TemplateRef.`,
        },
        {
          attribute: 'lvModalKey',
          type: 'string',
          default: 'null',
          description: `对话框的唯一性标识符，通过服务方式创建对话框时，请务必配置，以保证同一对话框的唯一性。`,
          description_en: `Unique identifier of modal. When you create a modal through service, you must configure it to ensure the uniqueness of the same modal.`,
        },
        {
          attribute: 'lvWidth',
          type: 'number | string',
          default: 'auto',
          description: `对话框宽度。`,
          description_en: `MessageBox width.`,
          global: true,
        },
        {
          attribute: 'lvHeight',
          type: 'number | string',
          default: 'auto',
          description: `对话框高度。`,
          description_en: `MessageBox height.`,
        },
        {
          attribute: 'lvIndex',
          type: 'number',
          default: '1000',
          description: `对话框层级 index。`,
          description_en: `MessageBox level: index。`,
        },
        {
          attribute: 'lvKeyboardEscape',
          type: 'boolean',
          default: 'false',
          description: `键盘事件，点击"ESC"键关闭对话框，默认不开启。`,
          description_en: `Keyboard event, click the "ESC" button to close the messageBox, the default is not open.`,
          global: true,
        },
        {
          attribute: 'lvDraggable',
          type: 'boolean',
          default: 'true',
          description: `是否可拖拽移动。`,
          description_en: `Whether to drag and move. `,
          global: true,
        },
        {
          attribute: 'lvOkLoading',
          type: 'boolean',
          default: 'false',
          description: `默认按钮 "OK" 的 Loading 状态。`,
          description_en: `Loading status of the default button "OK".`,
        },
        {
          attribute: 'lvCancelLoading',
          type: 'boolean',
          default: 'false',
          description: `默认按钮 "Cancel" 的 Loading 状态。`,
          description_en: `Loading status of the default button "Cancel".`,
        },
        {
          attribute: 'lvOkDisabled',
          type: 'boolean',
          default: 'false',
          description: `默认按钮 "OK" 的禁用状态。`,
          description_en: `Disabled state of default button "OK".`,
        },
        {
          attribute: 'lvCancelDisabled',
          type: 'boolean',
          default: 'false',
          description: `默认按钮 "Cancel" 的禁用状态。`,
          description_en: `Default button "Cancel" disabled state.`,
        },
        {
          attribute: 'lvOkText',
          type: 'string',
          default: 'Ok | 确定',
          description: `默认按钮 "OK" 的名称。`,
          description_en: `The name of the default button "OK".`,
        },
        {
          attribute: 'lvCancelText',
          type: 'string',
          default: 'Cancel | 取消',
          description: `默认按钮 "Cancel" 的名称。`,
          description_en: `The name of the default button "Cancel".`,
        },
        {
          attribute: 'lvOkType',
          type: 'primary | link | default',
          default: 'primary',
          description: `默认按钮 "OK" 的类型。`,
          description_en: `The type of the default button "OK".`,
        },
        {
          attribute: 'lvCancelType',
          type: 'primary | link | default',
          default: 'default',
          description: `默认按钮 "Cancel" 的类型。`,
          description_en: `The type of the default button "Cancel".`,
        },
        {
          attribute: 'lvOkLoadingText',
          type: 'string',
          default: 'Loading',
          description: `默认按钮 "OK" 的 Loading 文本。`,
          description_en: `The Loading text of the default button "OK".`,
        },
        {
          attribute: 'lvCancelLoadingText',
          type: 'string',
          default: 'Loading',
          description: `默认按钮 "Cancel" 的 Loading 文本。`,
          description_en: `The loading text for the default button "Cancel".`,
        },
        {
          attribute: 'lvCloseButtonDisplay',
          type: 'boolean',
          default: 'true',
          description: `关闭按钮的可见状态。`,
          description_en: `Turns off the visible state of the button.`,
        },
        {
          attribute: 'lvFocusButtonId',
          type: 'string',
          default: 'null',
          description: `设置当前对话框的焦点按钮；更改默认按钮 (Ok/Cancel) 的焦点，对应的ID分别为: 'ok'、'cancel'。`,
          description_en: `Set the focus button of current modal; change the focus of default button (OK/Cancel), the corresponding IDs of which are 'OK' and 'Cancel'.`,
        },
        {
          attribute: 'lvOuterClosable',
          type: 'boolean',
          default: 'false',
          description: `在弹窗外部点击时是否关闭对话框。`,
          description_en: `Whether to close the messageBox when clicking outside the popup.`,
          global: true,
        },
        {
          attribute: 'lvMaskTransparent',
          type: 'boolean',
          default: 'false',
          description: `遮罩是否透明。`,
          description_en: `Whether the mask is transparent.`,
          global: true,
        },
        {
          attribute: 'lvClass',
          type: 'string',
          default: 'null',
          description: `自定义弹窗样式。`,
          description_en: `Customize the pop-up style.`,
        },
        {
          attribute: 'lvDialogIcon',
          type: 'string',
          default: '--',
          description: `设置消息对话框的图标，值为SVG Symbol ID。`,
          description_en: `Set the icon of the message messageBox with a value of SVG Symbol ID.`,
        },
        {
          attribute: 'lvBeforeOpen',
          type: 'fn()',
          default: '--',
          description: `打开对话框前的回调函数，执行异步事件时返回promise，返回值为false可阻止打开。`,
          description_en: `Callback function before opening the messageBox. Promise will be returned when executing an asynchronous event. If the returned value is false, closing can be prevented.`,
        },
        {
          attribute: 'lvAfterOpen',
          type: 'fn(modal)',
          default: '--',
          description: `打开对话框后的回调函数。`,
          description_en: `Callback function after opening the messageBox.`,
        },
        {
          attribute: 'lvBeforeClose',
          type: 'fn(modal, result)',
          default: '--',
          description: `关闭对话框前的回调函数，传递当前 messageBox 实例和一个类型为 any 的参数。执行异步事件时返回promise，返回值为false可阻止关闭。`,
          description_en: `Callback function before closing the messageBox, transmit the current message-box instance and a parameter of type any. Promise will be returned when executing an asynchronous event. If the returned value is false, closing can be prevented.`,
        },
        {
          attribute: 'lvAfterClose',
          type: 'fn(result)',
          default: '--',
          description: `关闭对话框后的回调函数，传递一个类型为 any 的参数。`,
          description_en: `Callback function after closing the message-box, transmit a parameter of type any.`,
        },
        {
          attribute: 'lvOk',
          type: 'fn(modal)',
          default: '--',
          description: `点击对话框默认按钮 "OK" 时的执行函数，执行异步事件时返回promise，返回值为false可阻止关闭。`,
          description_en: `Executing function when clicking the default button 'OK' of the message-box. Promise will be returned when executing an asynchronous event. If the returned value is false, closing can be prevented.`,
        },
        {
          attribute: 'lvCancel',
          type: 'fn(modal)',
          default: '--',
          description: `点击对话框默认按钮 "Cancel" 时的执行函数，执行异步事件时返回 promise，返回值为false可阻止关闭。`,
          description_en: `Executing function when clicking the default button 'Cancel' of the message-box. Promise will be returned when executing an asynchronous event. If the returned value is false, closing can be prevented.`,
        },
      ],
    },
  ],
};
